// MainFrm.h : interfaces for bitmap menu classes 
// originally written by Burchak Alexander, alexburchak@ua.fm
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_BITMAPMENU_H__40F76A29_0193_4DAC_A4A2_0EA16547FF85__INCLUDED_)
#define AFX_BITMAPMENU_H__40F76A29_0193_4DAC_A4A2_0EA16547FF85__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CBitmapMenu : public CMenu  
{  
public:
	class CItemBitmap
	{ 
	public :
		CItemBitmap(UINT nID, CImageList *pil, UINT nPos);
		~CItemBitmap();
		
	protected :
		UINT m_nID;
		CImageList *m_pil;
		UINT m_nPos;
		
		friend class CBitmapMenu;
	};
	
	typedef struct MENUDRAWINGINFO
	{  
		COLORREF crHighlight;
		COLORREF crBackColor;
		COLORREF crText;
		COLORREF crDisabled;
		NONCLIENTMETRICS ncm;
		long lDims;
		CFont font;
	}  MENUDRAWINGINFO, *LPMENUDRAWINGINFO;
	
	CBitmapMenu();
	virtual ~CBitmapMenu();
	
// Attributes
protected :
//	static CList<CItemBitmap *, CItemBitmap *>  m_listBitmaps;
	CMap<UINT, UINT, CItemBitmap*, CItemBitmap*> m_mapBitmaps;
	
	// Operations
public :
	void Initialize(UINT uMennID, CWnd *pParent);
	UINT AddBitmaps(CItemBitmap *pib, UINT uCount);
	UINT RemoveBitmaps(CItemBitmap *pib, UINT uCount);
	static void __cdecl Synchronize(CMenu *pMenu);
	
protected :
	CBitmap m_bmpxx;
	void ReloadSysInfo(LPMENUDRAWINGINFO mdi, BOOL bFontBold = FALSE) const;
	
	// Overrides
	// ClassWizard generated virtual function overrides
public :
	BOOL m_bShowAccelerator;
	void OnSysColorChange();
	//{{AFX_VIRTUAL(CMainFrame)
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	//}}AFX_VIRTUAL
};

typedef class CBitmapMenu::CItemBitmap CMenuItemBitmap;

#endif // !defined(AFX_BITMAPMENU_H__40F76A29_0193_4DAC_A4A2_0EA16547FF85__INCLUDED_)
